package ace.module.account.sdk.core.feign.impl;

import ace.cmp.core.model.R;
import ace.cmp.openfeign.security.oauth2.core.config.FeignInternalServerOauth2SecurityConfig;
import ace.module.account.api.model.dto.IamAccountPasswordDto;
import ace.module.account.sdk.core.feign.IamAccountPasswordFeignApi;
import ace.module.common.api.annotation.ApiRemoteProxyPriority;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import ace.module.account.sdk.core.constant.SdkConstant;

/**
* 账户的密码 rpc feign.
*
* @author Caspar
*/
@FeignClient(
    name = "${spring.cloud.openfeign.client.config.iamAccountPasswordFeign.name:" + SdkConstant.FEIGN_SERVICE_NAME + "}",
    contextId = "iamAccountPasswordFeign",
    path = IamAccountPasswordFeign.PATH,
    configuration = FeignInternalServerOauth2SecurityConfig.class,
    primary = false
)
@ApiRemoteProxyPriority
public interface IamAccountPasswordFeign extends IamAccountPasswordFeignApi {
  String PATH = "${spring.cloud.openfeign.client.config.iamAccountPasswordFeign.path:/account/iam-account-password/rpc}";

  /**
   * 获取对应通知证账号的密码
   *
   * @param iamAppId
   * @param passport
   * @param passportTypes
   * @return
   */
  @GetMapping("/getByIamAppIdAndPassportAndPassportTypes")
  R<List<IamAccountPasswordDto>> getByIamAppIdAndPassportAndPassportTypes(
      @Valid @NotNull @RequestParam("iamAppId") Long iamAppId,
      @Valid @NotEmpty @RequestParam("passport") String passport,
      @Valid @NotEmpty @RequestParam("passportTypes") List<Integer> passportTypes);
}
